package com.xiaoke.java3;


import java.io.FileReader;
import java.io.IOException;
import java.util.Date;

/**
 * 返回指令包含ireturn(boolean,byte,char,short,int类型时使用)
 * lreturn、freturn、dreturn、以及areturn，另外还有一个return指令供声明为void方法
 * 实例初始化方法、类和接口的初始化方法使用
 *
 * @author yd
 * @version 1.0
 * @date 2022/1/13 22:23
 */
public class ReturnAddressTest {

    public boolean methodBoolean(){
        return false;
    }
    public byte methodByte(){
        return 0;
    }
    public short methodShort(){
        return 0;
    }
    public char methodChar(){
        return 'a';
    }
    public int methodInt(){
        return 0;
    }
    public long methodLong(){
        return 0L;
    }
    public float methodFloat(){
        return 0.0f;
    }
    public double methodDouble(){
        return 0.0;
    }
    public String methodString(){
        return null;
    }
    public Date methodDate(){
        return  null;
    }

    public void methodVoid(){

    }

    static {
        int i = 10;
    }


    public void method2(){
        methodVoid();

        try {
            method1();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public void method1() throws IOException {

        FileReader fis = new FileReader("aa.txt");
        char[] cBuffer = new char[1024];
        int len;
        System.out.println(cBuffer);
        while((len = fis.read(cBuffer)) != -1){
            String s = new String(cBuffer, 0, len);
            System.out.println(s);
        }
        fis.close();

    }



}
